package com.example.agriapp.model;

import android.net.Uri;
import android.provider.BaseColumns;

import com.example.agriapp.model.bean.FeedItem;

import java.util.List;

// FeedContract.java
public interface FeedContract {
    interface View {
        void showFeeds(List<FeedItem> feeds);
        void updateFeedItem(FeedItem item);
        void showLoading();
        void hideLoading();
        void showError(String message);
        void navigateToShop(String shopName);
        void showPostSuccess();
    }

    interface Presenter {
        void loadFeeds(int type);
        void likeFeed(FeedItem item);
        void unlikeFeed(FeedItem item);
        void followUser(FeedItem item);
        void unfollowUser(FeedItem item);
        void postNewFeed(String content, Uri imageUri);
        void onDestroy();
    }

    public static class FeedEntry implements BaseColumns {
        public static final String TABLE_NAME = "feeds";
        public static final String COLUMN_USER_ID = "user_id";
        public static final String COLUMN_USERNAME = "username";
        public static final String COLUMN_AVATAR = "avatar";
        public static final String COLUMN_CONTENT = "content";
        public static final String COLUMN_DATE = "date";
        public static final String COLUMN_LIKES = "likes";
        public static final String COLUMN_COMMENTS = "comments";
        public static final String COLUMN_HAS_SHOP = "has_shop";
        public static final String COLUMN_IS_FOLLOWED = "is_followed";
        public static final String COLUMN_TAG = "tag";
        public static final String COLUMN_IMAGE_URI = "image_uri";
    }

    // 定义ContentProvider的URI
    public static final String AUTHORITY = "com.example.friend.provider";
    public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/feeds");

}